package src.itheima01;

import java.util.LinkedList;

public class B {
    public static void main(String[] args) {
        LinkedList<String>linkedList=new LinkedList();
        linkedList.add("212");
        linkedList.add("2");
        System.out.println(linkedList);//[212, 2]
        linkedList.addFirst("111");
        System.out.println(linkedList);;//[111, 212, 2]
        linkedList.addLast("4");
        System.out.println(linkedList);//[111, 212, 2, 4]
        String b=linkedList.get(2);
        System.out.println(b);//2
        String a=linkedList.getFirst();
        System.out.println(a);//111
       String aaa= linkedList.removeLast();
        System.out.println(aaa);//4


    }
}
